﻿Public Class Rempresa

    Public Shared Function SeleccionarTodo(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean) As List(Of Eempresa)
        Dim empresas As List(Of Eempresa) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                empresas = Dempresa.SeleccionarTodo(descEmpresa)
                If empresas Is Nothing Then empresas = New List(Of Eempresa)
                If DisplaySelect Then empresas.Insert(0, New Eempresa("00", "-- SELECCIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return empresas
    End Function

End Class
